import subprocess

try:
    result = subprocess.run(['ddc'], capture_output=True, text=True, check=True)

    print(result.stdout)

except Exception as e:
    print('fail: ', e)

# ping
# pings = subprocess.Popen(['ls', '-l', '/' ], stdout=subprocess.PIPE, text=True)
# stdout, stderr =pings.communicate()
# print("stdout: ", stdout)

# print("stderr: ", stderr)


# ping
sleeps = subprocess.Popen(['ls', '/'], text=True)
print("poll: ", sleeps.poll())
stdout, stderr = sleeps.communicate()

print("poll: ", sleeps.poll())